﻿<!--#Include File="../Inc/Const.Asp"-->
<!--#Include File="Inc/Class_Setting.Asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>系统配置</title>
<link href="Images/Style.Css" rel="stylesheet" type="text/css" />
</head>
<body>
<%

Call ChkLogin("setting")

Dim U
Set U = New Cls_Setting

Dim JumpUrl
JumpUrl = "Admin_Setting.Asp"
If Request("Act") = "UpDate" Then
	If Not U.Update() Then Alert U.LastError,JumpUrl Else Alert "",JumpUrl
Else
	Call Main_Guide()
End If
If IsObject(Conn) Then Conn.Close : Set Conn = Nothing

Sub Main_Guide()
	%>
<table width=100% border=0 cellpadding=3 cellspacing=1 class=css_table bgcolor='#E1E1E1'>
	<tr class=css_menu>
		<td colspan=2>
			<table width=100% border=0 cellpadding=4 cellspacing=0 class=css_main_table>
				<tr>
					<td class=css_main><a href=Admin_Setting.Asp>系统配置</a></td>
				</tr>
			</table>
		</td>
	</tr>
	<form name='frm' method='post' action='Admin_Setting.Asp?Act=UpDate'>
	<%
	Dim Rs,i,j,Tmp,Tv,Tn,Formset
	Set Rs = DB("Select [Title],[Name],[Value],[Values],[Data],[Form],[Description] From [{pre}Config] Order By [Order] Asc",1)
	Do While Not Rs.Eof
	j = j + 1
	formset = split(Rs(5) & ",,,,,",",")
	%>
		<tr>
			<td class=css_col1<%=(j mod 2)+1%>><%=Rs(0)%>：<%=Rs(1)%>
				<div id='h<%=Rs(1)%>' style="color:#ccc;letter-spacing: 0px;font-size:13px;"><%=Rs(6)%></div>
			</td>
			<td class=css_col2<%=(j mod 2)+1%>>
				<%
				Select Case LCase(formset(0))
				Case "input"
				%>
				<input class='css_input' name="o<%=Rs(1)%>" type="text" id="o<%=Rs(1)%>" onfocus="h<%=Rs(1)%>.style.color='red';" onblur="h<%=Rs(1)%>.style.color='#ccc';" value="<%=Server.HtmlEnCode(Rs(2) & "")%>" style="width:300px;" >
				<%
				Case "templatefile"
				%>
				<select class='css_select' name="o<%=Rs(1)%>" type="text" id="o<%=Rs(1)%>" onfocus="h<%=Rs(1)%>.style.color='red';" onblur="h<%=Rs(1)%>.style.color='#ccc';" style="width:150px;"><%=selecttemplatefile(Rs(2),formset(1))%></select>
				<%
				Case "textarea"
				%>
				<textarea class='css_textarea' name="o<%=Rs(1)%>" type="text" id="o<%=Rs(1)%>" onfocus="h<%=Rs(1)%>.style.color='red';" onblur="h<%=Rs(1)%>.style.color='#ccc';" cols="50" rows="5" ><%=Server.HtmlEnCode(Rs(2) & "")%></textarea>      
				<%
				Case "select"
				%>
				<select class='css_select' name="o<%=Rs(1)%>" type="text" id="o<%=Rs(1)%>" onfocus="h<%=Rs(1)%>.style.color='red';" onblur="h<%=Rs(1)%>.style.color='#ccc';" style="width:150px;">
					<%
					If Len(Rs(3)) > 0 Then
						Tmp = Split(Rs(3),"|||")
						For i= 0 To UBound(Tmp)
							If Instr(Tmp(i),"=>") > 0 Then
								Tv = Split(Tmp(i),"=>")(0) : Tn = Split(Tmp(i),"=>")(1)
							Else
								Tv = Tmp(i) : Tn = Tmp(i)
							End If
							Response.Write "<option value=""" & Tv & """"
							If LCase(Tv) = LCase(Rs(2)) Then Response.Write " selected "
							Response.Write ">" & Tn & "</option>"
						Next
					End If
					%>
				</select>
				<%
				End Select
				%>
			</td>
		</tr>
	<%
	Rs.MoveNext
	Loop
	Rs.CLose : Set Rs = Nothing
	%>
		<tr class=css_page_list>
			<td colspan=2>
				<input type='submit' name='Submit' value='保存'>
			</td>
		</tr>
	</form>
</table>
<%
End Sub
%>

</body>
</html>
